/* 
 * 编辑器JS 2014.1.3
 */


/**
 * 编辑器调取
 * @param {string} textarea_id id值
 * @param {type} bar 工具样式 1:basicbars 2:fullBars 3:simpleBars
 * @param {int} height 高度需要带像素单位
 * @param {int} width 宽度
 * @returns 
 */
function obtain_editor(textarea_id,bar,height,width){
    var bar,height = height ? height : '200px',width = width ? width : '640px';
    if(bar === 1){
        var toolbars = ["source", "|", "fontname", "fontsize", "|", "justifyleft", "justifycenter", "justifyright", "|", "forecolor",
    "hilitecolor", "bold", "italic", "underline", "strikethrough", "lineheight", "removeformat",
    , "insertunorderedlist", "clearhtml", "|", "image","insertfile", "link", "unlink", "|", "fullscreen"];
    }else if(bar === 2){
        var toolbars = 'fullBars';
    }else{
        var toolbars = 'simpleBars';
    }
    KindEditor.ready(function(K) {
        window.editor = K.create("#"+textarea_id, {
            width:width,
            minWidth:width,//在Google浏览器下控制宽度
            height:height,
            items: toolbars
        });
    });
}



